import request from '@/utils/request'

export function add(data, ids) {
  return request({
    url: 'api/zhsq?ids=' + ids,
    method: 'post',
    data
  })
}

export function addGl(data, ids, delay) {
  return request({
    url: 'api/zhsq/createGl?ids=' + ids + '&delay=' + delay,
    method: 'post',
    data
  })
}

export function addSn(data, ids, delay) {
  return request({
    url: 'api/zhsq/createSn?ids=' + ids + '&delay=' + delay,
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/zhsq/',
    method: 'delete',
    data: ids
  })
}

export function edit(data, ids) {
  return request({
    url: 'api/zhsq?ids=' + ids,
    method: 'put',
    data
  })
}

export function editGl(data, ids) {
  return request({
    url: 'api/zhsq/updateGl?ids=' + ids,
    method: 'put',
    data
  })
}

export function editSn(data, ids) {
  return request({
    url: 'api/zhsq/updateSn?ids=' + ids,
    method: 'put',
    data
  })
}

export function updateOnlyZhsq(data) {
  return request({
    url: 'api/zhsq/updateOnlyZhsq',
    method: 'put',
    data
  })
}

export function onlyEdit(data) {
  return request({
    url: 'api/zhsq/onlyEdit',
    method: 'put',
    data
  })
}

export function submitZhsq(data, ids) {
  return request({
    url: 'api/zhsq/submitZhsq?ids=' + ids,
    method: 'put',
    data
  })
}

export function submitGl(data, ids, delay) {
  return request({
    url: 'api/zhsq/submitGl?ids=' + ids + '&delay=' + delay,
    method: 'put',
    data
  })
}

export function submitSn(data, ids, delay) {
  return request({
    url: 'api/zhsq/submitSn?ids=' + ids + '&delay=' + delay,
    method: 'put',
    data
  })
}

export function checkZhsq(data) {
  return request({
    url: 'api/zhsq/checkZhsq',
    method: 'put',
    data
  })
}

export function checkPgPcjgzh(data) {
  return request({
    url: 'api/zhsq/checkPgPcjgzh',
    method: 'put',
    data
  })
}

export function checkJbzxZhsq(data) {
  return request({
    url: 'api/zhsq/checkJbzxZhsq',
    method: 'put',
    data
  })
}

export function zpspZhsq(data) {
  return request({
    url: 'api/zhsq/zpspZhsq',
    method: 'put',
    data
  })
}

export function getApprove() {
  return request({
    url: 'api/zhsq/approve',
    method: 'get'
  })
}

export function getZhid(params) {
  return request({
    url: 'api/zhsq/queryZhid',
    method: 'get',
    params
  })
}

export function getZhHistory(params) {
  return request({
    url: 'api/zhsqHistory',
    method: 'get',
    params
  })
}

export function findZhsqById(params) {
  return request({
    url: 'api/zhsq/findZhsqById',
    method: 'get',
    params
  })
}

export function cancelZhsq(params) {
  return request({
    url: 'api/zhsq/cancelZhsq',
    method: 'delete',
    params
  })
}

export function updateById(params) {
  return request({
    url: 'api/zhsq/updateById',
    method: 'get',
    params
  })
}

export function queryAllQyJd() {
  return request({
    url: 'api/zhsq/queryAllQyJd',
    method: 'get'
  })
}

export function getSelfAnalyse(data) {
  return request({
    url: 'api/zhsq/getSelfAnalyse',
    method: 'post',
    data
  })
}

export function calculateOrgDelayDays(zhid) {
  return request({
    url: 'api/zhsq/calculateOrgDelayDays?zhid=' + zhid,
    method: 'get'
  })
}

export function getFpTargetDate(params) {
  return request({
    url: 'api/zhsq/getFpTargetDate',
    method: 'get',
    params
  })
}

export function getPdfScore(zhsqId) {
  return request({
    url: 'api/zhsq/pdfScore?zhsqId=' + zhsqId,
    method: 'get'
  })
}

export function getQzUser(zhsqId) {
  return request({
    url: 'api/zhsqHistory/getQzUser?zhsqId=' + zhsqId,
    method: 'get'
  })
}

export default { add, addGl, addSn, edit, editGl, editSn, del, checkZhsq, checkJbzxZhsq, checkPgPcjgzh, submitZhsq, submitGl, submitSn, getZhid, zpspZhsq,
  getZhHistory, findZhsqById, cancelZhsq, onlyEdit, updateById, queryAllQyJd, updateOnlyZhsq, getSelfAnalyse, calculateOrgDelayDays, getFpTargetDate,
  getPdfScore, getQzUser }
